package com.ruoyi.framework.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 添加分页插件，如果有的话
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }

    //@Bean
    //public ConfigurationCustomizer mybatisConfigurationCustomizer() {
    //    return new ConfigurationCustomizer() {
    //        @Override
    //        public void customize(org.apache.ibatis.session.Configuration configuration) {
    //            configuration.setCacheEnabled(false);
    //
    //        }
    //
    //
    //    };
    //}

}